package com.leo.ktvplayer.bluetooth;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by LeoLu on 2017/5/9.
 */

public class BleData implements Parcelable {
    /**
     * 接收或者返回的data
     */
    private byte[] data;
    /**
     * 返回的类型判断
     */
    private String title;


    protected BleData(Parcel in) {
        data = in.createByteArray();
        title = in.readString();
    }

    public static final Creator<BleData> CREATOR = new Creator<BleData>() {
        @Override
        public BleData createFromParcel(Parcel in) {
            return new BleData(in);
        }

        @Override
        public BleData[] newArray(int size) {
            return new BleData[size];
        }
    };

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByteArray(data);
        dest.writeString(title);
    }
}
